package io;

import sun.security.provider.ConfigFile;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class WriteStringDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos=new FileOutputStream("wd.txt",true);
//        String line=new String("红红火火恍恍惚惚或或或或或或或或或或或或或或");
//        byte[] data=line.getBytes(StandardCharsets.UTF_8);
        fos.write("红红火火恍恍惚惚或或或或或或或或或或或或或或hh123".getBytes(StandardCharsets.UTF_8));
        fos.close();











//        FileOutputStream fos=new FileOutputStream("fos.txt",true);
//        String line="明月几时有，把酒问青天，不知天上宫阙，今夕是何年";
//        byte[] data=line.getBytes(StandardCharsets.UTF_8);
//        fos.write(data);
//       fos.write("，我欲乘风归去，又恐琼楼玉宇".getBytes(StandardCharsets.UTF_8));
//        System.out.println("写出完毕");
//        fos.close();
    }
}
